package com.fangyi.yunmusic.controller;

import com.fangyi.yunmusic.config.ResourceConfig;
import com.fangyi.yunmusic.exception.YunMusicException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController{

    @Autowired
    private ResourceConfig resourceConfig;

    @GetMapping("/hello")
    public Object hello() {
        return "hello";
    }

    @GetMapping("/exception")
    public void exception() {
        throw new YunMusicException("异常");
    }

    @GetMapping("/test")
    public Object test() {
        return resourceConfig.getFileServer();
    }
}
